import "./public-path";
import React from "react";
import ReactDOM from "react-dom/client";

import AppWrapper from "./AppWrapper";
import App from "./App";
import "./index.css";

import { ThemeProvider, useTheme } from "@/theme/themeContext";

import { ConfigProvider } from "antd";

const root = ReactDOM.createRoot(document.getElementById("root"));

if (!window.__POWERED_BY_QIANKUN__) {
  root.render(
    <ConfigProvider
      theme={{
        token: {
          // Seed Token，影响范围大
          colorPrimary: "#00965E",
          // borderRadius: 2,

          // // 派生变量，影响范围小
          // colorBgContainer: "#f6ffed",
        },
      }}
    >
      <App />
    </ConfigProvider>
  );
}

export async function bootstrap() {
  console.log("[react-sub-app] bootstraped");
}

export async function mount(props) {
  ReactDOM.createRoot(document.getElementById("root")).render(<App />);
}
export async function unmount() {
  ReactDOM.createRoot(document.getElementById("root")).unmount();
}
